home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / FWExcLib / Include / FWTryBlo.h < prev   
Encoding:
C/C++ Source or Header  |  1995-11-08  |  2.1 KB  |  80 lines  |  [TEXT/MPS ]

  1. #ifndef FWTRYBLO_H
  2. #define FWTRYBLO_H
  3.  
  4. //========================================================================================
  5. //
  6. //    File:                FWTryBlo.h
  7. //    Release Version:    $ 1.0d11 $
  8. //
  9. //    Copyright:    (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //========================================================================================
  12.  
  13. #ifndef FW_NATIVE_EXCEPTIONS
  14.  
  15. #include <setjmp.h>
  16.  
  17. #ifndef   FWEXCTAS_H
  18. #include "FWExcTas.h"
  19. #endif
  20.  
  21. #if FW_LIB_EXPORT_PRAGMAS
  22. #pragma lib_export on
  23. #endif
  24.  
  25. //========================================================================================
  26. // CLASS FW_CPrivTryBlockContext
  27. //========================================================================================
  28.  
  29. class FW_CLASS_ATTR FW_CPrivTryBlockContext
  30. {
  31. public:
  32.     FW_CPrivTryBlockContext(FW_SPrivExceptionGlobals& globals, jmp_buf buffer);
  33.     ~FW_CPrivTryBlockContext();
  34.     
  35.     void *operator new(size_t, void *);
  36.     void operator delete(void *);
  37.  
  38.     FW_SPrivExceptionGlobals&     fGlobals;
  39.     class FW_CPrivTryBlockContext     *fPriorContext;
  40.     _FW_StackEntries             fDeleteStackLevel;
  41.     jmp_buf                        *fJumpBuffer;
  42.  
  43. #ifdef FW_DEBUG
  44.     short                        fAutomaticsInMyScope;
  45.     unsigned short                 fTraceDepth;
  46.     void                        CheckClassInvariants(FW_SPrivExceptionGlobals& globals);
  47. #endif
  48.  
  49. private:
  50.  
  51.     static FW_CPrivTryBlockContext    *MakeCurrent(FW_SPrivExceptionGlobals& globals,
  52.                                             FW_CPrivTryBlockContext *context);
  53.  
  54. };
  55.  
  56. //----------------------------------------------------------------------------------------
  57. // FW_CPrivTryBlockContext::operator new
  58. //----------------------------------------------------------------------------------------
  59.  
  60. inline void* FW_CPrivTryBlockContext::operator new(size_t, void *ptr)
  61. {
  62.     return ptr;
  63. }
  64.  
  65. //----------------------------------------------------------------------------------------
  66. // FW_CPrivTryBlockContext::operator delete
  67. //----------------------------------------------------------------------------------------
  68.  
  69. inline void FW_CPrivTryBlockContext::operator delete(void *)
  70. {
  71. }
  72.  
  73. #if FW_LIB_EXPORT_PRAGMAS
  74. #pragma lib_export off
  75. #endif
  76.  
  77. #endif // FW_NATIVE_EXCEPTIONS
  78.  
  79. #endif
  80.